<template>
	<div class="message-rd">
		<common-header title="站内信" isFixed=true></common-header>
		<div class="nu-contain">
			<ul class="message-list mt10">
				<li class="message-item" v-for="(item,index) in list">
					<div class="message-header ofH">
						<span class="title slh fl">{{item.cate_title}}</span>
						<span class="time fr">{{item.update_time | formatTime}}</span>
					</div>
					<div class="message-content slh2">
						{{item.description}}
					</div>
					<router-link class="message-footer ofH" :to="{path: '/messagedetail', query:{id: item.id}}">
						<span class="fl">查看详情</span>
						<span class="fr h-arrow"></span>
					</router-link>
				</li>
			</ul>
		</div>
	</div>
</template>

<style scoped lang="scss">
	.message-rd{padding-top: 44px;}
	.nu-contain{padding: 0 a(30px) 40px;}
	.message-item{
		padding:0 15px;
		margin-bottom: 10px;
		.message-header{
			padding-top: 10px;
			@include lh(40px);
			.title{
				font-size: 18px;
				width: 70%;
			}
			.time{
				font-size: 12px;
				width: 25%;
			}
		}
		.message-content{
			font-size: 13px;
			color:#666666;
			margin-top: 10px;
			line-height: 23px;
			margin-bottom: 10px;
		}
		.message-footer{
			display: block;
			@include lh(40px);
			font-size: 14px;
		}
		background: #ffffff;
	}
	.h-arrow:after{margin-right: 5px;}
</style>

<script>
	import commonHeader from "__cp/commonHeader";
	import {getArticleList} from '__api';
	import {fTime} from '__assets/js/util';
	export default{
		name:"message",
		components:{commonHeader},
		data(){
			return{
				list:[]
			}
		},
		filters:{
            formatTime:function(val){
                return fTime(val);
            }
        },
		created(){
			this.getList();
		},
		methods:{
			getList(){
				getArticleList().then(res=>{
					console.log(res)
					this.list = this.list.concat(res.artilce_item);
				})
			}
		}
	}

</script>